﻿using Microsoft.Win32;
using System.Windows;
using System.Windows.Controls;

namespace MapleLeaf.Client.Injector {
    /// <summary>
    /// ConfigView.xaml 的交互逻辑
    /// </summary>
    public partial class ConfigView : UserControl {
        public ConfigView() { }
        internal ConfigView(HongshPayClientInjectorConfig Config) {
            DataContext = Config;
            InitializeComponent();
        }


        private void FileBrowserButton_Click(object sender, RoutedEventArgs e) {
            OpenFileDialog openFileDialog = new OpenFileDialog {
                Filter = "目标|*.exe;*.dll"
            };
            bool? flag = openFileDialog.ShowDialog();
            if (flag.GetValueOrDefault() & flag != null) {
                (DataContext as HongshPayClientInjectorConfig).TargetPath = openFileDialog.FileName;
            }
        }
    }
}
